#ifndef __OUNIT_DEF_H__
#define __OUNIT_DEF_H__

class oBody;
class oWorld;
class oGroup;

struct oDLL b2BodyDef;

class oDLL oBodyDef: public b2BodyDef, public CCObject
{
public:
	~oBodyDef();
	static b2FixtureDef* polygon(
		const b2Vec2& center,
		float width,
		float height,
		float angle,
		float density,
		float friction,
		float restitution);
	b2FixtureDef* attachPolygon(
		const b2Vec2& center,
		float width,
		float height,
		float angle,
		float density,
		float friction,
		float restitution);
	static b2FixtureDef* polygon(
		float width,
		float height,
		float density,
		float friction,
		float restitution);
	b2FixtureDef* attachPolygon(
		float width,
		float height,
		float density,
		float friction,
		float restitution);
	static b2FixtureDef* polygon(
		const vector<b2Vec2>& vertices,
		float density,
		float friction,
		float restitution);
	b2FixtureDef* attachPolygon(
		const vector<b2Vec2>& vertices,
		float density,
		float friction,
		float restitution);
	static b2FixtureDef* loop(
		const vector<b2Vec2>& vertices,
		float friction,
		float restitution);
	b2FixtureDef* attachLoop(
		const vector<b2Vec2>& vertices,
		float friction,
		float restitution);
	static b2FixtureDef* circle(
		const b2Vec2& center,
		float radius,
		float density,
		float friction,
		float restitution);
	b2FixtureDef* attachCircle(
		const b2Vec2& center,
		float radius,
		float density,
		float friction,
		float restitution);
	static b2FixtureDef* circle(
		float radius,
		float density,
		float friction,
		float restitution);
	b2FixtureDef* attachCircle(
		float radius,
		float density,
		float friction,
		float restitution);
	static b2FixtureDef* chain(
		const vector<b2Vec2>& vertices,
		float friction,
		float restitution);
	b2FixtureDef* attachChain(
		const vector<b2Vec2>& vertices,
		float friction,
		float restitution);
	static b2FixtureDef* polygonSensor(
		uint32 tag,
		float width,
		float height);
	b2FixtureDef* attachPolygonSensor(
		uint32 tag,
		float width,
		float height);
	static b2FixtureDef* polygonSensor(
		uint32 tag,
		float width,
		float height,
		const b2Vec2& center,
		float angle);
	b2FixtureDef* attachPolygonSensor(
		uint32 tag,
		float width,
		float height,
		const b2Vec2& center,
		float angle);
	static b2FixtureDef* polygonSensor(
		uint32 tag,
		const vector<b2Vec2>& vertices);
	b2FixtureDef* attachPolygonSensor(
		uint32 tag,
		const vector<b2Vec2>& vertices);
	static b2FixtureDef* circleSensor(
		uint32 tag,
		const b2Vec2& center,
		float radius);
	b2FixtureDef* attachCircleSensor(
		uint32 tag,
		const b2Vec2& center,
		float radius);
	static b2FixtureDef* circleSensor(
		uint32 tag,
		float radius);
	b2FixtureDef* attachCircleSensor(
		uint32 tag,
		float radius);
	void attach(b2FixtureDef* fixtureDef);
	PROPERTY_READONLY_REF(vector<b2FixtureDef*>, Fixtures);
	void clearFixtures();
	static oBodyDef* create();
	static void destroyFixtureDef(b2FixtureDef*& fixtureDef);
	oBody* toBody(oWorld* world, oGroup* group, float x, float y, float angle);
protected:
	oBodyDef();
private:
	vector<b2FixtureDef*> _fixtures;
};

#endif